home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-09-18 | 32.2 KB | 1,195 lines |
- TABLE OF CONTENTS
-
- MuiToolkit/-Preface-
- MuiToolkit/mt_Get
- MuiToolkit/mt_ParseHotkey
- MuiToolkit/mt_Label
- MuiToolkit/mt_PopButton
- MuiToolkit/mt_Checkmark
- MuiToolkit/mt_Cycle
- MuiToolkit/mt_CycleWeight
- MuiToolkit/mt_Slider
- MuiToolkit/mt_SliderFmt
- MuiToolkit/mt_String
- MuiToolkit/mt_StringSecret
- MuiToolkit/mt_StringAccept
- MuiToolkit/mt_StringReject
- MuiToolkit/mt_Button
- MuiToolkit/mt_ButtonWeight
- MuiToolkit/mt_ButtonToggle
- MuiToolkit/mt_WinOpen
- MuiToolkit/mt_WinClose
- MuiToolkit/mt_WinAttach
- MuiToolkit/mt_WinDetach
- MuiToolkit/mt_Text
- MuiToolkit/mt_GetStringA
- MuiToolkit/mt_GetIntegerA
- MuiToolkit/mt_Radio
- MuiToolkit/mt_Check
-
- MuiToolkit/-Preface-
-
- Anyone being the author of more than one MUI based application most
- probably realized, that using some predefined MUI macros
- (<libraries/mui.h>) speeds up 'writting' the GUI, but most of the authors
- sooner of later write their own bunch of functions and uses them for
- creation of the gui instead of standard one. And so did I, creating my own
- pool of routines I use in my apps to approach "TLBRTS" (Type Less But Reach
- The Same{tm} ;-) goal.
-
-
- 1. Why ppl creates own functions while, as I said, mui.h defines
- some useful you said macros?
-
- IMHO mostly because these macros are useful but very limited. To make your
- GUI nice and useable you still have to set other tags by hand. For
- instance Cycle() macro most of ppl use to create Cycle objects does not put
- your object in cycle chain (so your user can't activate your object while
- browsing thru the object chain with TAB). It also does not help you making
- your cycle object hotkey driven. And the I find most lame is, especially
- in context of MUI based applications, the lack of keyboard control. That
- the user's point of view. As programmer, I don't like typing too much,
- especially I know it can look simplier.
-
-
- 2. Any clue then?
-
- I just moved all my own MUI related helper-functions into the shared
- library (named muitoolkit as you probably guessed). It features all
- helper-functions *I* use in my apps to create user interface. For example,
- to create basic but 'comfortable' string object, with bubble help, hotkey
- and being cycle chaied, instead of typing:
-
- obj = StringObject,
- MUIA_Frame, MUIV_Frame_String,
- MUIA_ControlChar, 't',
- MUIA_String_MaxLen, maxlen,
- MUIA_CycleChain, TRUE,
- MUIA_String_AdvanceOnCR, TRUE,
- MUIA_String_Contents, "str",
- MUIA_String_MaxLen, 30,
- MUIA_ShortHelp, "I hate typing",
- End;
-
- I just type:
-
- obj = mt_String("hi", 30, "_Type something", "I love that");
-
- and voila. Nice? Hope so ;-)
-
- Note: the hotkey in the above example is automatically extracted out of
- the "_Type something" label string. It may look stupid at the 1st sight,
- but if you realize, the most hotkey driven objects are paired with labels,
- then you probably find out that the string "_Type something" is in fact the
- label string. So you pass the same string to mt_Label() call while
- creating the label, and to related mt_String() (or any other MT object) and
- you are done with hotkey driven object. It became even more 'natural' when
- you use localization (and you should)), so your translators have easier
- job.
-
- Among the object creation functions, MuiToolkit also features string,
- numeric string requester (something like ReqTools offers for instance) etc.
- And I plan more of course. For now, don't forget to watch enclosed
- demo program!
-
-
- 3. Who would benefit from using such library?
-
- I think we all could. Programmers (some of us), because they can type less
- and still got good and user friendly interfaces. The app will reduce in
- size (well, recently not much about 10K, but it's v1.0, but later, who
- knows ;). The users (we all), because the GUI of MUI programs may start to
- be less 'primitive' and more "friendly". I hope "user friendly" would stop
- mean that "the user have to be friendly", which is unfortunately ofter for
- not, only begginers' app.
-
-
- 4. Fees?
-
- MuiToolkit is and will remain freeware. The source will be placed in CVS
- so anyone would be able to contribute (welcome, welcome!) or to bug fix.
-
-
- 5. Author
-
- Marcin Orlowski
- P.O. Box 91
- 71-507 Szczecin 5
- Poland
-
- e-mail: carlos@amiga.com.pl
- WWW: http://wfmh.org.pl/~carlos/
-
-
- $Id: muitoolkit.doc,v 1.2 1999/09/01 21:28:43 carlos Exp $
-
- MuiToolkit/mt_Get
-
- NAME
- mt_Get - easier getting object arguments
-
- SYNOPSIS
- mt_Get( object, attribute );
- A0 D0
-
- ULONG mt_Get( Object *object, ULONG attribute );
-
- FUNCTION
- Just easier to use get() macro replacement. Instead
- of giving the pointer to ULONG for the result value
- (that's the often begginers' bug), you get it returned
- as from other functions.
-
- INPUTS
- object - the pointer to Object to query
- attribute - the attribute you want to know the value of
-
- RESULT
- Attribute value (depends on object GET method handling)
- or NULL.
-
- EXAMPLE
- printf("Volume is %ld dB\n", mt_Get(obj, MUIA_Slider_Level));
-
- SEE ALSO
-
- BUGS
-
- MuiToolkit/mt_ParseHotkey
-
- NAME
- mt_ParseHotkey - parses given string and returns hot key (if any)
-
- SYNOPSIS
- mt_ParseHotkey( string );
- A0
-
- char mt_ParseHotkey( char *string );
-
- FUNCTION
- However MT powered GUI objects automatically use hotkeys whenever
- available, if it may would be useful (for some purposes) to you to
- find out if in the given string any hotkey is defined, call this
- function. By hotkey, I mean the character (letter, numer etc) that
- should be used e.g. for keyboard object control. Since gadtools
- the standard of defining the hotkey is to prefix the character
- with the underscore ('_').
-
- INPUTS
- string - the string to parse
-
- RESULT
- The first found hotkey character or NULL if there's no such present.
-
- EXAMPLE
- mt_ParseHotkey("What's _the hotkey?");
-
- would return 't' char
-
- SEE ALSO
-
- BUGS
-
- MuiToolkit/mt_Label
-
- NAME
- mt_Label - creates label object
-
- SYNOPSIS
- mt_Label( string );
- A0
-
- Object * mt_Label( char *string );
-
- FUNCTION
- Creates so called label. You usually use labels to describe the
- meaning of the gadget (e.g. "Your name" before string gadget is
- the good label example). This function creates such object for
- you, taking care of the proper hotkey handling (if label uses
- such) etc.
-
- INPUTS
- string - the label text itself
-
- RESULT
- Pointer to created object, or NULL if failed
-
- EXAMPLE
- mt_Label("_Server name:");
-
- SEE ALSO
-
- BUGS
-
- MuiToolkit/mt_PopButton
-
- NAME
- mt_PopButton - creates image pop button object
-
- SYNOPSIS
- mt_PopButton( imgage, label )
- D0 A0
-
- Object * mt_PopButton( int image, char *label );
-
- FUNCTION
- The goal of using this call instead of built-in MUI macro is,
- that your popup button will be automatically cyclechained
- (but that obvious for MT ;-) and you can easily hotkey it.
-
- INPUTS
- image - the image type (see MUII_#? values)
- label - the label string, MT will try to extract the
- hotkey from, or NULL if you either don't have
- any, or don't want the button to be hotkeyed
-
- RESULT
- Pointer to created object, or NULL if failed
-
- EXAMPLE
- mt_PopButton( MUII_PopUp, GetString( MSG_BAUD_LABEL ) );
-
- SEE ALSO
- libraries/mui.h for MUII_#?
-
- BUGS
-
- MuiToolkit/mt_Checkmark
-
- NAME
- mt_Checkmark - creates checkmark object
-
- SYNOPSIS
- mt_Checkmark( label, value, help )
- A0 D0 A1
-
- Object * mt_Checkmark( char *label, BOOL value, char *help );
-
- FUNCTION
- The simple way of creating nice checkmark object with one call.
-
- INPUTS
- label - the label string, MT will try to extract the
- hotkey from, or NULL if you either don't have
- any, or don't want the object to be hotkeyed
- value - startup value of the object (TRUE/FALSE)
- help - optional pointer to the bubble help text,
- or NULL if you don't have any
-
- RESULT
- Pointer to created object, or NULL if failed
-
- EXAMPLE
- mt_Checkmark( GetString( LABEL ), FALSE, "Select if you\nwant to ;-)");
-
- SEE ALSO
-
- BUGS
-
- MuiToolkit/mt_Cycle
-
- NAME
- mt_Cycle - creates nice cycle object
-
- SYNOPSIS
- mt_Cycle( array, label, value, help )
- A0 A1 d0 A2
-
- Object * mt_Cycle( char *array, char *label,
- ULONG value, char *help );
-
- FUNCTION
- The simple way of creating nice cycle object with one call.
-
- INPUTS
- array - Here you can define what entries
- shall be displayed in your cycle gadget.
- You must supply a pointer to a string array,
- containing one entry for each item and
- terminated with a NULL.
-
- Remember that cycle gadget entries may
- contain any text formatting code such
- as bold, italic or underlined characters.
-
- Cycle gadgets set the preparse string
- for all entries to "\33c", this means
- that they will automatically appear
- centered. Of course you can override this
- by simply preceding your entries with own
- formatting code.
- label - the label string, MT will try to extract the
- hotkey from, or NULL if you either don't have
- any, or don't want the object to be hotkeyed
- value - startup value of the object
- help - optional pointer to the bubble help text,
- or NULL if you don't have any
-
- RESULT
- Pointer to created object, or NULL if failed
-
- EXAMPLE
- static const char *CycleArray[] =
- {
- "normal",
- "highlight",
- "3-dimensional",
- NULL
- };
-
- mt_Cycle( CycleArray, "_Preview", 2, NULL);
-
- SEE ALSO
- Cycle object autodocs
-
- BUGS
-
- MuiToolkit/mt_CycleWeight
-
- NAME
- mt_Cycle - creates nice cycle object with given weight
-
- SYNOPSIS
- mt_Cycle( array, label, value, weight, help )
- A0 A1 d0 D1 A2
-
- Object * mt_Cycle( char *array, char *label, ULONG value,
- long weight, char *help );
-
- FUNCTION
- The same as mt_Cycle, but you can determine the weight of
- the newly created object.
-
- INPUTS
- array - Cycle entries
- label - the label string, MT will try to extract the
- hotkey from, or NULL if you either don't have
- any, or don't want the object to be hotkeyed
- value - startup value of the object
- weight - weight of the object
- help - optional pointer to the bubble help text,
- or NULL if you don't have any
-
- RESULT
- Pointer to created object, or NULL if failed
-
- EXAMPLE
- static const char *CycleArray[] =
- {
- "normal",
- "highlight",
- "3-dimensional",
- NULL
- };
-
- mt_CycleWeight( CycleArray, "_Preview", 2, 50, NULL);
-
- SEE ALSO
- mt_Cycle, Cycle object autodocs, Area/MUIA_Weight
-
- BUGS
-
- MuiToolkit/mt_Slider
-
- NAME
- mt_Slider - creates slider object with one call
-
- SYNOPSIS
- mt_Slider( min, max, level, label, help )
- D0 D1 D2 A0 A1
-
- Object * mt_Slider( int min, int max, int level,
- char *str, char *help );
-
- FUNCTION
- Creates slider object
-
- INPUTS
- min - the minimal value
- max - the maxum
- level - default level of the knob
- label - the label string, MT will try to extract the
- hotkey from, or NULL if you either don't have
- any, or don't want the object to be hotkeyed
- help - optional pointer to the bubble help text,
- or NULL if you don't have any
-
- RESULT
- Pointer to created object, or NULL if failed
-
- EXAMPLE
-
- SEE ALSO
- mt_Slider
-
- BUGS
-
- MuiToolkit/mt_SliderFmt
-
- NAME
- mt_SliderFmt - creates slider object with custom
- format text
-
- SYNOPSIS
- mt_SliderFmt( min, max, level, label, fmt, help )
- D0 D1 D2 A0 A1 A2
-
- Object * mt_SliderFmt( int min, int max, int level,
- char *label, char *fmt, char *help )
-
-
- FUNCTION
- Creates slider object with defined format text
-
- INPUTS
- min - the minimal value
- max - the maxum
- level - default level of the knob
- label - the label string, MT will try to extract the
- hotkey from, or NULL if you either don't have
- any, or don't want the object to be hotkeyed
- fmt - the format string, where "%ld" instance will
- be replaced by the current knob value
- help - optional pointer to the bubble help text,
- or NULL if you don't have any
-
- RESULT
- Pointer to created object, or NULL if failed
-
- EXAMPLE
- mt_SliderFmt( 10,30,20, "_Delay", "%ld sec.", "Delay in seconds");
-
- SEE ALSO
- mt_Slider, MUIA_Slider_Format
-
- BUGS
-
- MuiToolkit/mt_String
-
- NAME
- mt_String - creates string object
-
- SYNOPSIS
- mt_String( string, maxlen, label, help )
- A0 D0 A1 A2
-
-
- Object * mt_String( char *string, int maxlen,
- char *label, char *help );
-
- FUNCTION
- Creates string object. Recently MT uses built-in string
- object class to construct the gadget, but future versions may
- automatically (and transparently to your application) benefit
- from all these string gadget replacements like Textinput or
- Betterstring classes
-
- INPUTS
- string - default string contents (or NULL or "" if none)
- maxlen - the max len of the string allowed to be entered
- (including terminating NULL byte)
- label - the label string, MT will try to extract the
- hotkey from, or NULL if you either don't have
- any, or don't want the object to be hotkeyed
- help - optional pointer to the bubble help text,
- or NULL if you don't have any
-
- RESULT
- Pointer to created object, or NULL if failed
-
- EXAMPLE
- mt_String( "NoName", 30, "_Project", NULL);
-
- SEE ALSO
- String class autodocs
-
- BUGS
-
- MuiToolkit/mt_StringSecret
-
- NAME
- mt_StringSecret - creates secret string object
-
- SYNOPSIS
- mt_StringSecret( string, maxlen, label, help )
- A0 D0 A1 A2
-
-
- Object * mt_StringSecret( char *string, int maxlen,
- char *label, char *help );
-
-
- FUNCTION
- Same as mt_String, but the object will be echoing "*" instead
- of entered characters (good for passwords etc).
-
- INPUTS
- string - default string contents (or NULL or "" if none)
- maxlen - the max len of the string allowed to be entered
- (including terminating NULL byte)
- label - the label string, MT will try to extract the
- hotkey from, or NULL if you either don't have
- any, or don't want the object to be hotkeyed
- help - optional pointer to the bubble help text,
- or NULL if you don't have any
-
- RESULT
- Pointer to created object, or NULL if failed
-
- EXAMPLE
- mt_StringSecret( NULL, 30, "_Passwd", NULL);
-
- SEE ALSO
- String class autodocs, MUIA_String_Secret
-
- BUGS
-
- MuiToolkit/mt_StringAccept
-
- NAME
- mt_StringAccept - creates string object with given
- pool of character pool object accepts
- for input
-
- SYNOPSIS
- mt_StringAccept( string, maxlen, label, accept, help )
- A0 D0 A1 A2 A3
-
-
- Object * mt_StringAccept( char *string, int maxlen,
- char *label, char *accept,
- char *help );
-
-
- FUNCTION
- Same as mt_String, but you can specify what characters user
- may enter. Useful for e.g. IRC nick etc.
-
- INPUTS
- string - default string contents (or NULL or "" if none)
- maxlen - the max len of the string allowed to be entered
- (including terminating NULL byte)
- accept - the string with the allowed charasters
- label - the label string, MT will try to extract the
- hotkey from, or NULL if you either don't have
- any, or don't want the object to be hotkeyed
- help - optional pointer to the bubble help text,
- or NULL if you don't have any
-
- RESULT
- Pointer to created object, or NULL if failed
-
- EXAMPLE
- mt_StringAccept( NULL, 30, "abcdef", "_Passwd", "Try any digit");
-
- SEE ALSO
- String class autodocs, MUIA_String_Accept
-
- BUGS
-
- MuiToolkit/mt_StringReject
-
- NAME
- mt_StringReject - creates string object with given
- pool of not allowed characters
-
- SYNOPSIS
- mt_StringReject( string, maxlen, label, reject, help )
- A0 D0 A1 A2 A3
-
-
- Object * mt_StringReject( char *string, int maxlen,
- char *label, char *reject,
- char *help );
-
-
- FUNCTION
- Same as mt_String, but you can specify what characters user
- may enter. Useful for e.g. IRC nick etc.
-
- INPUTS
- string - default string contents (or NULL or "" if none)
- maxlen - the max len of the string allowed to be entered
- (including terminating NULL byte)
- reject - the string with charasters to reject on input
- label - the label string, MT will try to extract the
- hotkey from, or NULL if you either don't have
- any, or don't want the object to be hotkeyed
- help - optional pointer to the bubble help text,
- or NULL if you don't have any
-
- RESULT
- Pointer to created object, or NULL if failed
-
- EXAMPLE
- mt_StringReject( NULL, 30, "0123456789", "_Passwd", "Try any digit");
-
- SEE ALSO
- String class autodocs, MUIA_String_Reject
-
- BUGS
-
- MuiToolkit/mt_Button
-
- NAME
- mt_Button - creates simple button object
-
- SYNOPSIS
- mt_Button( label, help )
- A0 A1
-
-
-
- Object * mt_Button( char *label, char *help );
-
-
- FUNCTION
- Creates ordinary text button object.
-
-
- INPUTS
- label - the button text. MT will try to extract the
- hotkey from this string and use it if present
- help - optional pointer to the bubble help text,
- or NULL if you don't have any
-
- RESULT
- Pointer to created object, or NULL if failed
-
- EXAMPLE
- mt_Button( "_Save", "Saves the Queen" );
-
- SEE ALSO
-
- BUGS
-
- MuiToolkit/mt_ButtonWeight
-
- NAME
- mt_ButtonWeight - creates simple button object with given
- object weight
-
- SYNOPSIS
- mt_ButtonWeight( label, weight, help )
- A0 D0 A1
-
-
-
- Object * mt_ButtonWeight( char *label, int weight, char *help );
-
-
- FUNCTION
- Creates ordinary text button object (same as mt_Button), but
- sets object weight to the given value
-
-
- INPUTS
- label - the button text. MT will try to extract the
- hotkey from this string and use it if present
- weight - object weight
- help - optional pointer to the bubble help text,
- or NULL if you don't have any
-
- RESULT
- Pointer to created object, or NULL if failed
-
- EXAMPLE
- mt_ButtonWeight( "_Save", 10, "Saves the Queen" );
-
- SEE ALSO
- MUIA_Weight
-
- BUGS
-
- MuiToolkit/mt_ButtonToggle
-
- NAME
- mt_ButtonToggle - creates simple toggle button object
-
- SYNOPSIS
- mt_ButtonToggle( label, help )
- A0 A1
-
-
-
- Object * mt_ButtonToggle( char *label, char *help );
-
-
- FUNCTION
- Creates ordinary text button object with toggle input mode.
- Useful for button based checkmark alikes.
-
-
- INPUTS
- label - the button text. MT will try to extract the
- hotkey from this string and use it if present
- help - optional pointer to the bubble help text,
- or NULL if you don't have any
-
- RESULT
- Pointer to created object, or NULL if failed
-
- EXAMPLE
- mt_ButtonToggle( "AutoSave", "If active, would save the Queen every 10 minutes" );
-
- SEE ALSO
- MUIA_InputMode
-
- BUGS
-
- MuiToolkit/mt_WinOpen
-
- NAME
- mt_WinOpen - opens the given window object with the check
-
- SYNOPSIS
- mt_WinOpen( window )
- A0
-
-
- ULONG mt_WinOpen( Object *window );
-
-
- FUNCTION
- Opens given window object, and checks if window was succesfuly opened.
- The one of major bugs in (even serious MUI apps) is the assumption that
- everything will work fine. So programmers sets the MUIA_Window_Open
- to TRUE and don't bother checking if the window is opened! And there're
- many many situations that may cause the open window to fail. And then
- user is stucked, because e.g. to continue, s/he needs to press "Proceed"
- in unopened window.
-
- INPUTS
- window - the window object to open
-
- RESULT
- FALSE if window open failed, otherwise TRUE
-
- EXAMPLE
- if( mt_WinOpen( MyWindow ) )
- {
- //... ok, it worked ;-)
- }
- else
- {
- printf( "Can't open window!\n" );
- }
-
- SEE ALSO
- mt_WinClose, MUIA_Window_Open
-
- BUGS
-
- MuiToolkit/mt_WinClose * THIS IS A MACRO *
-
- NAME
- mt_WinClose - closes the given window object
-
- SYNOPSIS
-
- void mt_WinOpen( Object *window );
-
-
- FUNCTION
- Closes given window object. This is a *MACRO* (see includes), not a
- real library function. It was defined just to pair mt_WinOpen.
-
- INPUTS
- window - the window object to close
-
- RESULT
-
-
- EXAMPLE
- mt_WinClose( MyWindow );
-
-
- SEE ALSO
- mt_WinOpen, libraries/muitoolkit.h
-
-
- BUGS
-
- MuiToolkit/mt_WinAttach
-
- NAME
- mt_WinAttach - attach the given window object to the application
-
- SYNOPSIS
- mt_WinAttach( app, window )
- A0 A1
-
-
- ULONG mt_WinAttach( Object *app, Object *window );
-
-
- FUNCTION
- This is a support call for the programmers writting their applications
- in the Right Way{tm}, with the dynamically created objects. Imagine
- your program offers 20 various windows for various purposes. Creating
- all of them at the program start is just a waste of time and resources.
- The Right Way{tm} is to create them only when necessary (e.g. user is
- going to use it), attach the created window object to application,
- and then destroy when user finished (note: sometimes may be better to
- keep created windows. That prevents the gadgets contents from being lost
- which in result would force the user to select/type/pick the values
- again, which may be unwanted feature for some kind of applications).
-
- It's safe to pass NULL as any of the argument.
-
-
- INPUTS
- app - the application object the window should be added to
- window - the window object to add
-
- RESULT
- FALSE if window couldn't be added, otherwise TRUE. See the BUGS!
-
- EXAMPLE
-
- Object *win = WindowObject,
- // our dynamically created window...,
- End;
-
-
- if( mt_WinAttach( app, win ) )
- {
- if( mt_WinOpen( MyWindow ) )
- {
- //... ok, it worked ;-)
- }
- else
- {
- printf( "Can't open window!\n" );
- }
- }
-
- SEE ALSO
- mt_WinDetach
-
- BUGS
- Recently, return value indicates that the function arguments were
- correct (both are not NULL), and NOT that the window is succesfuly
- attached. Further versions will do that check anyway.
-
- MuiToolkit/mt_WinDetach
-
- NAME
- mt_WinDetach - detach the given window object from the application
-
- SYNOPSIS
- mt_WinDetach( app, window )
- A0 A1
-
-
- void mt_WinDetach( Object *app, Object *window );
-
-
- FUNCTION
- This function removes the given window from the applicatin. It,
- at least recently, does nothing else that OM_REMMEMBER, however
- further releases will offer more features here. If you added
- windows with mt_WinAttach, you should remove them with thah call
-
- It's safe to pass NULL as any of the argument.
-
-
- INPUTS
- app - the application the window should be removed from
- window - the window object to remove
-
- RESULT
- FALSE if window couldn't be added, otherwise TRUE. See the BUGS!
-
- EXAMPLE
- mt_WinDetach( app, win ) );
-
- SEE ALSO
-
- BUGS
-
- MuiToolkit/mt_Text
-
- NAME
- mt_Text - creates text object
-
- SYNOPSIS
- mt_Text( text, preparse)
- A0 A1
-
-
- Object * mt_Text( char *text, char *preparse );
-
-
- FUNCTION
- Creates ordinary text object with
-
-
- INPUTS
- text - contents of the text obejct
- preparse - MUI preparse formatter (e.g. "\033c" for centering)
-
- RESULT
- Pointer to created object, or NULL if failed
-
-
- EXAMPLE
- mt_WinDetach( app, win ) );
-
- SEE ALSO
-
- BUGS
-
- MuiToolkit/mt_GetString
-
- NAME
- mt_GetString - Full featured string requester
-
-
- mt_GetStringA(app, buffer, buf_len, tags)
- A0 A1 D0 A2
-
- LONG mt_GetStringA ( Object *app, char *buffer, ULONG buf_len,
- struct TagItem *tags );
-
- LONG mt_GetString ( Object *app, char *buffer, ULONG buf_len, ... );
-
-
- FUNCTION
- Pops up a string requester.
-
-
-
- INPUTS
- app - application object
-
- buffer - pointer to the memory area (array etc), where the user
- entered string will be placed
-
- buf_len - max lenght of the buffer
-
- tags - optional tags. If you don't want to use any, put TAG_DONE
- See TAGS below
-
-
- TAGS
- mt_StrReq_WinTitle - (STRPTR) custom requester window title
-
- mt_StrReq_Contents - (STRPTR) default string gadget contents
-
- mt_StrReq_Ok - (STRPTR) text you want to have as OK button
-
- mt_StrReq_Cancel - (STRPTR) text you want to have as the CANCEL
- button
-
- mt_StrReq_Secret - (BOOL) if TRUE, turns the requester into Secret
- mode. In that mode, only "*" are echoed instead
- of entered characters (good for passwords etc).
- Default: FALSE
-
- mt_StrReq_NoEmpty - (BOOL) if TRUE, requester won't accept the empty
- string as the positive answers. User will have
- to click CANCEL to dismiss the requester, or
- type something. Good to force users to give e.g.
- new account name etc.
-
- mt_StrReq_GroupTitle - (STRPTR) the replacement string for "Enter string"
- string gadget header
-
- mt_StrReq_Info - (STRPTR) by using this tag, you can add extra info
- text panel above the string gadget, with detailed
- description or whatever you want. See the demo
-
- mt_StrReq_StringHelp - (STRPTR) optional bubble help text
-
-
- RESULT
- TRUE if user gave valid positive answer, otherwise FALSE
-
-
- EXAMPLE
- char buf[40];
- mt_GetString( app, buf, sizeof(buf),
- mt_StrReq_Contents, "Hello",
- TAG_DONE );
-
-
- SEE ALSO
- mt_demo.c
-
- BUGS
-
- MuiToolkit/mt_GetInteger
-
- NAME
- mt_GetInteger - Full featured integer requester
-
-
- mt_GetIntegerA(app, value, tags)
- A0 A1 A2
-
- LONG mt_GetIntegerA ( Object *app, LONG *value, struct TagItem *tags );
-
- LONG mt_GetInteger ( Object *app, LONG *value, ... );
-
-
- FUNCTION
- Pop up a numeric requester. Recently it supports integers only, but
- both positive and negative values are properly handled.
-
-
- INPUTS
- app - application object
- value - pointer to the longword (32 bit) where the, where the user
- entered value will be returned
- tags - optional tags. If you don't want to use any, put TAG_DONE
- See TAGS below
-
-
- TAGS
- mt_IntReq_WinTitle - (STRPTR) custom requester window title
-
- mt_IntReq_Value - (LONG) default string gadget contents
-
- mt_IntReq_Ok - (STRPTR) text you want to have as OK button
-
- mt_IntReq_Cancel - (STRPTR) text you want to have as the CANCEL
- button
-
- mt_IntReq_Min - (LONG) Optional, min value requester can accept
- as correct answer
-
- mt_IntReq_Max - (LONG) Optional, max value requester can accept
- as correct answer
-
- mt_IntReq_GroupTitle - (STRPTR) the replacement string for "Enter string"
- string gadget header
-
- mt_IntReq_Info - (STRPTR) by using this tag, you can add extra info
- text panel above the string gadget, with detailed
- description or whatever you want. See the demo
-
- mt_IntReq_StringHelp - (STRPTR) optional bubble help text
-
-
- RESULT
- TRUE if user gave valid positive answer, otherwise FALSE
-
-
- EXAMPLE
-
- LONG val;
- mt_GetInteger( app, &val,
- mt_IntReq_Min, 30,
- mt_IntReq_Max, 50,
- TAG_DONE );
-
- SEE ALSO
- mt_demo.c
-
- BUGS
-
- MuiToolkit/mt_Radio
-
- NAME
- mt_Radio - creates radio button
-
- SYNOPSIS
- mt_Radio( array, label, help )
- A0 A1 A2
-
-
- Object * mt_Radio( char *array, char *label, char *help );
-
-
- FUNCTION
- Creates radio buttons.
-
-
- INPUTS
- array - Here you can define what entries shall be
- displayed in your radio gadget. You must
- supply a pointer to a string array, containing
- one entry for each item and terminated with a NULL.
-
- Remember that radio gadget entries may contain any
- text formatting code such as bold, italic or
- underlined characters.
-
- label - the label string, MT will try to extract the
- hotkey from, or NULL if you either don't have
- any, or don't want the button to be hotkeyed
-
- help - optional pointer to the bubble help text,
- or NULL if you don't have any
-
- RESULT
- Pointer to created object, or NULL if failed
-
- EXAMPLE
- char *radio[] = { "Apples",
- "Bananas",
- "Plums",
- NULL };
- mt_Radio( radio, GetString( Label ), "ShortHelp" );
-
- SEE ALSO
- mt_demo.c
-
- BUGS
-
- MuiToolkit/mt_Check
-
- NAME
- mt_Check - expanded checkmark object
-
- SYNOPSIS
- mt_Check( label, alignment, state, help )
- A0 D0 D1 A1
-
-
- Object * mt_Check( char *label, ULONG alignment,
- ULONG state, char *help);
-
-
- FUNCTION
- Creates expanded checkmark object. This function can can
- create ordinary checkmark, as well as complex one, with
- its label.
-
-
- INPUTS
- label - the checkmark label string. If not NULL and
- alignmet is not mt_Check_NoLabel, MT will
- create a label, next to the checkmark object.
- MT will as usual try to extract the hotkey from
- this string as well
-
- alignment - if label is not NULL, you can specify the way
- MT should handle it. Available options are:
-
- mt_Check_NoLabel - don't create the label,
- just use the string as
- hotkey source
- mt_Check_AlignRight - create label on the right
- side of the checkmark
- mt_Check_AlignLeft - create label on the left
- side of the checkmark
-
- state - (BOOL) state of the checkmark
-
- help - optional pointer to the bubble help text,
- or NULL if you don't have any
-
- RESULT
- Pointer to created object, or NULL if failed
-
- EXAMPLE
- mt_Check( "_Check 1", mt_Check_AlignRight, FALSE, "ShortHelp" ),
-
- SEE ALSO
- mt_demo.c
-
- BUGS
-
-